:root {
    --border-color: var(--vscode-editorWidget-border);
    --primary-font: var(--vscode-font-family);
    --secondary-font: var(--vscode-editor-font-family);
    --background-color: var(--vscode-editor-background);
    --foreground-color: var(--vscode-editor-foreground);
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --button-bg: var(--vscode-button-background);
    --button-hover-bg: var(--vscode-button-hoverBackground);
    --button-active-bg: var(--vscode-button-background);
    --button-color: var(--vscode-button-foreground);
}

.vscode-light {
    --border-color: hsla(0, 0%, 0%, 0.06);
    --pre-bg-color: rgba(231, 231, 231, 0.4);
    --pre-border-color: rgba(10, 10, 10, 0.05);
    --pre-bg-color-hover: rgba(231, 231, 231, 0.7);
    --pre-bg-color-active: rgba(231, 231, 231, 0.4);
}

.vscode-dark {
    --pre-bg-color: rgba(10, 10, 10, 0.4);
    --pre-bg-color-hover: rgba(10, 10, 10, 0.5);
    --pre-bg-color-active: rgba(10, 10, 10, 0.4);
    --pre-border-color: hsla(0, 0%, 0%, 0.06);
}

.vscode-high-contrast {
    --pre-bg-color: rgba(255, 255, 255, 0);
    --pre-border-color: rgb(255, 255, 255);
    --pre-bg-color-hover: rgba(255, 255, 255, 0.2);
    --pre-bg-color-active: rgba(255, 255, 255, 0.1);
}

.vscode-high-contrast-light {
    --pre-bg-color: rgba(255, 255, 255, 0);
    --pre-border-color: rgb(0, 0, 0);
    --pre-bg-color-hover: rgba(10, 10, 10, 0.05);
    --pre-bg-color-active: rgba(10, 10, 10, 0.02);
}

html {
    line-height: 1.5;
    padding: 10px 30px;
    margin: 0;
    font-family: var(--primary-font);
    background-color: var(--background-color);
    color: var(--foreground-color);
}

body {
    padding: 0 10px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: inherit;
    font-weight: 500;
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
    margin: 10px 0 0;
}

h3 {
    margin: 16px 0;
    font-size: 1.25rem;
}

hr {
    border: 0;
    height: 1px;
    border-bottom: 1px solid var(--border-color);
}

a {
    color: var(--vscode-textLink-foreground);
    text-decoration: none;
}

a:hover {
    color: var(--vscode-textLink-activeForeground);
}

p {
    margin: 10px 0;
    font-size: 1rem;
    color: inherit;
}

p img {
    display: block;
    width: 100%;
    max-width: 500px;
}

ul,
ol {
    font-size: 1rem;
    margin: 10px 0;
    padding-left: 20px;
}

pre {
    word-break: initial;
    hyphens: none;
    position: relative;
    overflow: auto;
    display: block;
    padding: 0.75rem;
    background: var(--pre-bg-color, hsl(211, 20%, 97%));
    border: 1px solid var(--pre-border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

pre code {
    font-family: var(--secondary-font);
    font-size: 0.85rem;
    line-height: 1.5;
    border-radius: var(--border-radius);
    color: var(--vscode-editor-foreground);
    background-color: transparent;
    margin: 0 0.125rem;
    white-space: pre-wrap;
    display: block;
}

pre:hover {
    background-color: var(--pre-bg-color-hover);
}

.copy-button {
    position: absolute;
    right: 5px;
    top: 5px;
    padding: 5px 10px;
    border-radius: 5px;
    background-color: var(--vscode-button-background);
    color: var(--vscode-button-foreground);
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: none;
}

.copy-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.copy-button:hover {
    background-color: var(--vscode-button-hoverBackground);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

pre:hover .copy-button {
    display: block;
}

.pta-note {
    border: 0.5px solid var(--vscode-editor-foreground);
    border-radius: var(--border-radius);
    padding: 8px 16px;
    box-shadow: var(--box-shadow);
}

.content-container {
    padding-bottom: 3rem;
}

.button-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    border: 0;
    padding: 0.5rem;
    /* 确保 padding 不会增加元素的总宽度 */
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background-color: var(--vscode-sideBar-background);
    border-top: 1px solid var(--vscode-sideBar-border);
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.right-buttons {
    position: absolute;
    right: 0.85rem;
}

.button-container button {
    color: var(--button-color);
    background-color: var(--button-bg);
    border: none;
    padding: 0.45rem 0.85rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button-container button:hover {
    background-color: var(--button-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.button-container button:active {
    background-color: var(--button-active-bg);
    transform: translateY(0);
}

/* 更多操作按钮样式 */
.more-actions {
    position: relative;
    margin-right: 1rem;
}

.more-actions-trigger {
    background-color: var(--vscode-button-secondaryBackground) !important;
    color: var(--vscode-button-secondaryForeground) !important;
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.more-actions-icon {
    font-size: 1.25rem;
    line-height: 1;
    display: block;
}

.more-actions-menu {
    position: absolute;
    bottom: 50px;
    right: 0;
    background-color: var(--vscode-dropdown-background);
    border: 1px solid var(--vscode-dropdown-border);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: none;
    flex-direction: column;
    min-width: 150px;
    z-index: 10;
}

.more-actions-menu button {
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 0;
    background-color: transparent;
    color: var(--vscode-dropdown-foreground);
    box-shadow: none;
    border-bottom: 1px solid var(--vscode-dropdown-border);
}

.more-actions-menu button:last-child {
    border-bottom: none;
}

.more-actions-menu button:hover {
    background-color: var(--vscode-list-hoverBackground);
    transform: none;
    box-shadow: none;
}

.more-actions-menu.show {
    display: flex;
}

.banner .ques-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.875rem;
}

.banner .ques-info .detail,
.department {
    display: flex;
}

.banner-line {
    margin: 8px auto 10px;
}

.header {
    text-align: center;
}

.problem-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.problem-set-name {
    font-size: 1rem;
    color: var(--vscode-descriptionForeground);
}

.header h1 {
    margin: 0;
}

.problem-set-name a {
    color: inherit;
}

.header a:hover,
.content-container a:hover {
    color: var(--vscode-textLink-activeForeground);
    text-decoration: underline;
}

table {
    width: 100%;
    margin: 0 auto;
    border-collapse: collapse;
    text-align: center;
    font-size: 0.88rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

thead {
    font-size: 1rem;
}

th,
td {
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
}

.code-block {
    margin-top: 15px;
}

.code-block pre {
    margin: 0;
}

.build-output code {
    max-height: 400px;
    padding: 5px;
}

.code-preview code {
    line-height: 1.5;
    border-radius: var(--border-radius);
    color: var(--vscode-editor-foreground);
    margin: 0 0.125rem;
    display: block;
    padding: 5px;
}

.performance-details {
    margin-top: 1rem;
}

.performance-details summary {
    margin-bottom: 0.5rem;
}

.performance-content {
    padding: 0.5rem;
    border: 1px solid var(--vscode-sideBar-border);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.performance-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.performance-item .key {
    font-weight: normal;
}

.performance-item .value {
    text-align: right;
}

.performance-compiler {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--vscode-descriptionForeground);
}